package com.songshuai.customer.client.feign;

import com.songshuai.customer.client.config.MultipartSupportConfig;
import com.songshuai.webapi.baseapi.dto.feign.request.custminiprogram.*;
import com.songshuai.webapi.baseapi.dto.feign.response.DictionaryDto;
import com.songshuai.webapi.baseapi.dto.feign.response.custminiprogram.*;
import com.songshuai.webapi.baseapi.dto.pangu.request.service.AddInviteServiceItemReqDto;
import com.songshuai.webapi.baseapi.dto.pangu.request.service.ServiceReqDto;
import com.songshuai.webapi.baseapi.dto.pangu.response.service.InviteServiceItemTreeResDto;
import com.songshuai.webapi.baseapi.model.custminiprogram.YixueBaseCity;
import com.songshuai.webapi.baseapi.pojo.QueryResponse;
import feign.codec.Encoder;
import feign.form.spring.SpringFormEncoder;
import org.springframework.beans.factory.ObjectFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.web.HttpMessageConverters;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.cloud.netflix.feign.support.SpringEncoder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.context.annotation.Scope;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;


@FeignClient(name = "pangu-api",configuration = MultipartSupportConfig.class,fallback = PanguApiClientFallback.class)
public interface PanguApiClient {



    //根据userId获取会议列表
    @GetMapping(value = "/api/custmeeting/getMeetingListByUserId")
    QueryResponse<List<MeetingListResDto>> getMeetingListByUserId(@RequestParam("customId") String customId);


    //根据userId和会议编号获取会议详情
    @PostMapping(value = "/api/custmeeting/getMeetingDetail")
    QueryResponse<MeetingDetailResDto> getMeetingDetail(@RequestBody MeetingDetailReqDto parm);


    //根据会议编号获取邀约模板
    @GetMapping(value = "/api/custmeeting/getInvitationTemplateByCode")
    QueryResponse<List<InvitationTemplateResDto>> getInvitationTemplateByCode(@RequestParam("meetingCode") String meetingCode);


    //根据客户id和会议编号获取签到码
    @PostMapping(value = "/api/custmeeting/getWxQRCode")
    QueryResponse<WxQRCodeResDto> getWxQRCode(@RequestBody WxQRCodeReqDto parm);


    //校验签到码
    /*@GetMapping(value = "/api/custmeeting/registerSign")
    QueryResponse<Boolean> registerSign(@RequestParam("clueguid") Long clueguid,
                                        @RequestParam("meetingno") String meetingno,
                                        @RequestParam("timestamp") String timestamp,
                                        @RequestParam("hashcode") String hashcode);*/


    //新增签到码签到
    /*@PostMapping(value = "/api/custmeeting/QRCodeSign")
    QueryResponse<Boolean> QRCodeSign(@RequestBody QRCodeSignReqDto parm);*/


    //根据客户id和会议编号获取回执单
    @PostMapping(value = "/api/custmeeting/getMeetingReceipt")
    QueryResponse<MeetingReceiptResDto> getMeetingReceipt(@RequestBody MeetingReceiptReqDto parm);


    //新增回执单
    @PostMapping(value = "/api/custmeeting/addMeetingReceipt")
    QueryResponse<AddMeetingReceiptResDto> addMeetingReceipt(@RequestBody AddMeetingReceiptReqDto parm);


    //根据字典类型获取字典信息
    /*@GetMapping(value = "/api/custmeeting/getDictionaryByTypeId")
    QueryResponse<List<DictionaryResDto>> getDictionaryByTypeId(@RequestParam("dicType") Integer dicType);*/


    //根据会议编号获取车站信息
    @GetMapping(value = "/api/custmeeting/getAreaStations")
    QueryResponse<List<StationResDto>> getAreaStations(@RequestParam("meetingCode") String meetingCode);

    //获取全部车站信息
    @GetMapping(value = "/api/custmeeting/getAllStations")
    QueryResponse<List<StationResDto>> getAllStations();


    //根据id获取车站信息
    @GetMapping(value = "/api/custmeeting/getStationById")
    QueryResponse<StationResDto> getStationById(@RequestParam("id") Integer id);


    //我参与过的活动
    @GetMapping("/api/pangu/my/queryActivityList")
    QueryResponse queryActivityList(@RequestParam("userId")String userId);

    //我参与过的活动数
    @GetMapping("/api/pangu/my/queryActivityCount")
    QueryResponse queryActivityCount(@RequestParam("userId")String userId);

    /**
     * 获取客户销售顾问
     * @param userId 客户ID
     */
    @GetMapping(value = "/api/pangu/my/getSale")
    QueryResponse getSale(@RequestParam("userId") String userId);


    //根据字典类型查询字典
    @GetMapping("/api/common/queryDictionariesByType")
    QueryResponse<List<DictionaryDto>> queryDictionariesByType(@RequestParam("type")Integer type);


    //根据id查询字典详情
    @GetMapping("/api/common/queryDictionaryDetail")
    QueryResponse<DictionaryDto> queryDictionaryDetail(@RequestParam("id")Integer id);


    //上传图片
    @PostMapping(value ="/api/common/uploadPicture",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    QueryResponse uploadPicture(@RequestPart("file") MultipartFile file,@RequestParam("imgMaxSize") Integer imgMaxSize,
                                @RequestParam("basePath")String basePath,@RequestParam("imgPath")String imgPath);

    //上传图片
    @PostMapping(value ="/api/common/uploadPictureOss",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    QueryResponse uploadPictureOss(@RequestPart("file") MultipartFile file);


    /**
     * 查询服务标准化列表
     * @return
     */
    @GetMapping("/api/service/getAllServiceList")
    QueryResponse<List<InviteServiceItemTreeResDto>> getAllServiceList();

    /**
     * 获取邀约服务已反馈信息
     * @param reqDto
     * @return
     */
    @PostMapping("/api/service/getInviteServiceItems")
    QueryResponse<List<String>> getInviteServiceItems(@RequestBody ServiceReqDto reqDto);

    /**
     * 新增邀约服务反馈信息
     * @param reqDto
     * @return
     */
    @PostMapping("/api/service/addInviteServiceItem")
    QueryResponse<Boolean> addInviteServiceItem(@RequestBody AddInviteServiceItemReqDto reqDto);

    /**
     * 根据父id获取省市区列表
     * @param pId
     * @return
     */
    @GetMapping("/api/common/queryAreaByParentId")
    QueryResponse<List<YixueBaseCity>> queryAreaByParentId(@RequestParam("pId")Integer pId);



}



